package org.lds.hotkey.console.business.hotkey.converter;

import org.lds.hotkey.console.business.hotkey.entity.HotKey;
import org.lds.hotkey.console.business.hotkey.model.request.HotKeyBaseListPageRequest;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;


@Component
public class HotKeyBaseListPageRequestToEntityConverter implements Converter<HotKeyBaseListPageRequest, HotKey> {

    @Override
    public HotKey convert(HotKeyBaseListPageRequest source) {
        return HotKey.builder()
            .id(source.getId())
            .appId(source.getAppId())
            .key(source.getKey())
            .enable(source.getEnable())
            .duration(source.getDuration())
            .desc(source.getDesc())
            .createTime(source.getCreateTime())
            .updateTime(source.getUpdateTime())
            .build();
    }

}


